home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / g_man / cat3 / OpenGL-GLS / glsintro.z / glsintro
Text File  |  1998-10-20  |  41KB  |  529 lines

  1.  
  2.  
  3.  
  4. ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))                 OOOOppppeeeennnnGGGGLLLL SSSSttttrrrreeeeaaaammmm CCCCooooddddeeeecccc                  ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ggggllllssssIIIInnnnttttrrrroooo - Introduction to the OpenGL Stream Codec
  10.  
  11.  
  12.  
  13. OOOOVVVVEEEERRRRVVVVIIIIEEEEWWWW
  14.      The OpenGL Stream Codec (GLS) is a facility for encoding and decoding
  15.      streams of 8-bit bytes that represent sequences of OpenGL (henceforth,
  16.      "GL") commands.
  17.  
  18.      The GLS specification has two components:
  19.  
  20.      1.   A set of three byte-stream encodings for GL and GLS commands:
  21.           human-readable text, big-endian binary, and little-endian binary.
  22.           The three encodings are semantically identical; they differ only in
  23.           syntax. It is therefore possible to convert GLS byte streams freely
  24.           among the three encodings without loss of information.
  25.  
  26.      2.   An API that provides commands for encoding and decoding GLS byte
  27.           streams.  This API is not formally an extension of the GL API.  Like
  28.           the GLU API, the GLS API is designed to be implemented in an
  29.           optional, standalone client-side subroutine library that is separate
  30.           from the subroutine library that implements the GL API.
  31.  
  32.      The GLS encodings and API are platform independent and window system
  33.      independent.  In particular, the GLS encodings are not tied to the X
  34.      Window System protocol encoding used by the GLX extension.  GLS is
  35.      designed to work equally well in UNIX, Windows, and other environments.
  36.  
  37.      GLS can be used in a variety of situations, for example:
  38.  
  39.      *    GL command streams for resolution-independent storage, interchange,
  40.           viewing, and printing of pictures
  41.  
  42.      *    GL command files for persistent storage of textures, display lists,
  43.           images, and so on
  44.  
  45.      *    GL trace streams for debuggers, performance analyzers, and
  46.           simulators
  47.  
  48.      *    GL test-vector streams that test correctness of GL implementations
  49.  
  50.      *    Transfer of GL commands between application processes via byte-
  51.           stream connections
  52.  
  53.      *    Client-side display lists that can contain client callbacks
  54.  
  55.      Some of these applications require the definition and implementation of
  56.      higher-level APIs that are more convenient to use than the GLS API.  The
  57.      GLS API design is an attempt to provide basic encoding and decoding
  58.      services in such a way that higher-level services can efficiently be
  59.      built on top of it.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))                 OOOOppppeeeennnnGGGGLLLL SSSSttttrrrreeeeaaaammmm CCCCooooddddeeeecccc                  ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))
  71.  
  72.  
  73.  
  74.    GGGGLLLLSSSS EEEEnnnnccccooooddddiiiinnnnggggssss
  75.      Each of the GLS encodings (human-readable text, big-endian binary, and
  76.      little-endian binary) can represent all GL commands, without exception.
  77.      This includes "get" commands that return data to the GL client and other
  78.      commands that are not allowed in GL display lists.
  79.  
  80.      If a GL command has both a scalar form (for example ggggllllCCCCoooolllloooorrrr3333ffff(((())))) and a
  81.      vector form (for example, ggggllllCCCCoooolllloooorrrr3333ffffvvvv(((())))), GLS always represents the
  82.      command in its vector form.
  83.  
  84.      In addition to GL commands, a subset of the commands in the GLS API are
  85.      "encodable", that is, they can be represented in GLS streams.  These GLS
  86.      commands make it possible to encode various kinds of non-GL data in GLS
  87.      streams.
  88.  
  89.      The binary encodings represent most commands as 16 bits of opcode,
  90.      followed by 16 bits of byte-count, followed by zero or more 32-bit words
  91.      of argument data.  An alternate encoding is used for opcodes larger than
  92.      65535 and commands that require more than 65535 bytes to encode.
  93.  
  94.      The text encoding looks like C source code, except that array arguments
  95.      are represented as lists of elements delimited by braces.  Enumerants are
  96.      represented symbolically.  Here's an example of a GLS text stream:
  97.  
  98.          _gggg_llll_ssss_BBBB_eeee_gggg_iiii_nnnn_GGGG_LLLL_SSSS_((((_1111_,,,, _0000_))))_;;;; _#### _aaaa_rrrr_gggg_uuuu_mmmm_eeee_nnnn_tttt_ssss _aaaa_rrrr_eeee _mmmm_aaaa_jjjj_oooo_rrrr_,,,, _mmmm_iiii_nnnn_oooo_rrrr _GGGG_LLLL_SSSS _vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn
  99.          _gggg_llll_CCCC_llll_eeee_aaaa_rrrr_((((_GGGG_LLLL______DDDD_EEEE_PPPP_TTTT_HHHH______BBBB_UUUU_FFFF_FFFF_EEEE_RRRR______BBBB_IIII_TTTT _|||| _GGGG_LLLL______CCCC_OOOO_LLLL_OOOO_RRRR______BBBB_UUUU_FFFF_FFFF_EEEE_RRRR______BBBB_IIII_TTTT_))))_;;;;
  100.          _gggg_llll_BBBB_eeee_gggg_iiii_nnnn_((((_GGGG_LLLL______PPPP_OOOO_IIII_NNNN_TTTT_SSSS_))))_;;;;
  101.          _gggg_llll_VVVV_eeee_rrrr_tttt_eeee_xxxx_3333_ffff_vvvv_((((_{{{{_1111_...._2222_,,,, _3333_...._4444_,,,, _5555_...._6666_}}}}_))))_;;;;
  102.          _gggg_llll_EEEE_nnnn_dddd_((((_))))_;;;;
  103.          _gggg_llll_ssss_EEEE_nnnn_dddd_GGGG_LLLL_SSSS_((((_))))_;;;;
  104.  
  105.      All GLS streams begin with the encodable GLS command ggggllllssssBBBBeeeeggggiiiinnnnGGGGLLLLSSSS(((()))) and
  106.      end with the encodable GLS command ggggllllssssEEEEnnnnddddGGGGLLLLSSSS(((()))).  The concatenation of two
  107.      valid GLS streams is always a valid GLS stream, even if the two streams
  108.      do not have the same GLS encoding.
  109.  
  110.  
  111.    GGGGLLLLSSSS AAAAPPPPIIII
  112.      This section provides a brief overview of the core of the GLS API. It
  113.      consists of three subsections: "Working with Contexts", "Basic Stream
  114.      Capture" "Basic Stream and Playback", and "Modifying Stream Capture and
  115.      Playback".
  116.  
  117.    WWWWoooorrrrkkkkiiiinnnngggg wwwwiiiitttthhhh CCCCoooonnnntttteeeexxxxttttssss
  118.      Like GL, GLS defines a state machine.  A GLS context is an instantiation
  119.      of this state machine.  GLS contexts and GL contexts are completely
  120.      independent. GLS contexts are stored entirely on the client side of the
  121.      GL client-server connection.  Each GLS context has a nonzero name of type
  122.      GGGGLLLLiiiinnnntttt.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))                 OOOOppppeeeennnnGGGGLLLL SSSSttttrrrreeeeaaaammmm CCCCooooddddeeeecccc                  ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))
  137.  
  138.  
  139.  
  140.      Each GLS command is classified as either global, immediate, or encodable.
  141.      All immediate and encodable commands use the GLS context state.
  142.  
  143.      The commands ggggllllssssGGGGeeeennnnCCCCoooonnnntttteeeexxxxtttt(((()))), ggggllllssssDDDDeeeelllleeeetttteeeeCCCCoooonnnntttteeeexxxxtttt(((()))), and ggggllllssssCCCCoooonnnntttteeeexxxxtttt(((()))) (see
  144.      below)  are global.  All other GLS commands described on this page are
  145.      non-global.  Each client thread has a state variable that always contains
  146.      either zero (the initial value) or the name of the thread's current GLS
  147.      context.
  148.  
  149.      *    If the value is zero, all non-global GLS commands are no-ops, and
  150.           non-global GLS commands that return a value return zero.
  151.  
  152.      *    If the value is nonzero, all non-global GLS commands use the state
  153.           in the issuing thread's current GLS context.
  154.  
  155.      At any given instant, a GLS context may be current to at most one thread.
  156.  
  157.      The following functions are available for working with contexts:
  158.  
  159.          _GGGG_LLLL_iiii_nnnn_tttt _gggg_llll_ssss_GGGG_eeee_nnnn_CCCC_oooo_nnnn_tttt_eeee_xxxx_tttt_((((_vvvv_oooo_iiii_dddd_))))_;;;;
  160.          _vvvv_oooo_iiii_dddd _gggg_llll_ssss_DDDD_eeee_llll_eeee_tttt_eeee_CCCC_oooo_nnnn_tttt_eeee_xxxx_tttt_((((_GGGG_LLLL_iiii_nnnn_tttt _iiii_nnnn_CCCC_oooo_nnnn_tttt_eeee_xxxx_tttt_))))_;;;;
  161.          _vvvv_oooo_iiii_dddd _gggg_llll_ssss_CCCC_oooo_nnnn_tttt_eeee_xxxx_tttt_((((_GGGG_LLLL_iiii_nnnn_tttt _iiii_nnnn_CCCC_oooo_nnnn_tttt_eeee_xxxx_tttt_))))_;;;; _////_**** _ssss_eeee_tttt _tttt_hhhh_rrrr_eeee_aaaa_dddd_''''_ssss _cccc_uuuu_rrrr_rrrr_eeee_nnnn_tttt _GGGG_LLLL_SSSS _cccc_oooo_nnnn_tttt_eeee_xxxx_tttt _****_////
  162.  
  163.    BBBBaaaassssiiiicccc SSSSttttrrrreeeeaaaammmm CCCCaaaappppttttuuuurrrreeee
  164.      For basic stream capture, call ggggllllssssBBBBeeeeggggiiiinnnnCCCCaaaappppttttuuuurrrreeee(((()))).
  165.  
  166.      Between a ggggllllssssBBBBeeeeggggiiiinnnnCCCCaaaappppttttuuuurrrreeee(((()))) command and the following ggggllllssssEEEEnnnnddddCCCCaaaappppttttuuuurrrreeee(((())))
  167.      command, the current GLS context is in _c_a_p_t_u_r_e _m_o_d_e.  In capture mode,
  168.      all commands are captured instead of executed:
  169.  
  170.      *    All GL commands are captured by GLS instead of being sent directly
  171.           to GL and executed.
  172.  
  173.      *    All encodable GLS commands are captured instead of being sent
  174.           directly to GLS and executed.
  175.  
  176.      The command ggggllllssssBBBBeeeeggggiiiinnnnCCCCaaaappppttttuuuurrrreeee(((()))) opens a stream for writing and then encodes
  177.      the command ggggllllssssBBBBeeeeggggiiiinnnnGGGGLLLLSSSS(((()))).  The command ggggllllssssEEEEnnnnddddCCCCaaaappppttttuuuurrrreeee(((()))) encodes the
  178.      command ggggllllssssEEEEnnnnddddGGGGLLLLSSSS(((()))) and then closes the currently open GLS stream.
  179.  
  180.      ggggllllssssBBBBeeeeggggiiiinnnnCCCCaaaappppttttuuuurrrreeee(((()))) and ggggllllssssEEEEnnnnddddCCCCaaaappppttttuuuurrrreeee(((()))) have the following prototypes:
  181.  
  182.          _GGGG_LLLL_bbbb_oooo_oooo_llll_eeee_aaaa_nnnn _gggg_llll_ssss_BBBB_eeee_gggg_iiii_nnnn_CCCC_aaaa_pppp_tttt_uuuu_rrrr_eeee_((((
  183.              _cccc_oooo_nnnn_ssss_tttt _GGGG_LLLL_SSSS_cccc_hhhh_aaaa_rrrr _****_iiii_nnnn_SSSS_tttt_rrrr_eeee_aaaa_mmmm_NNNN_aaaa_mmmm_eeee_,,,,
  184.              _GGGG_LLLL_SSSS_eeee_nnnn_uuuu_mmmm _iiii_nnnn_SSSS_tttt_rrrr_eeee_aaaa_mmmm_TTTT_yyyy_pppp_eeee_,,,,
  185.              _GGGG_LLLL_iiii_nnnn_tttt _iiii_nnnn_WWWW_rrrr_iiii_tttt_eeee_FFFF_llll_aaaa_gggg_ssss
  186.          _))))_;;;;
  187.          _vvvv_oooo_iiii_dddd _gggg_llll_ssss_EEEE_nnnn_dddd_CCCC_aaaa_pppp_tttt_uuuu_rrrr_eeee_((((_vvvv_oooo_iiii_dddd_))))_;;;;
  188.  
  189.      The _i_n_S_t_r_e_a_m_T_y_p_e argument to ggggllllssssBBBBeeeeggggiiiinnnnCCCCaaaappppttttuuuurrrreeee(((()))) is one of:
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))                 OOOOppppeeeennnnGGGGLLLL SSSSttttrrrreeeeaaaammmm CCCCooooddddeeeecccc                  ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))
  203.  
  204.  
  205.  
  206.          _GGGG_LLLL_SSSS______CCCC_OOOO_NNNN_TTTT_EEEE_XXXX_TTTT             _////_**** _iiii_nnnn_----_mmmm_eeee_mmmm_oooo_rrrr_yyyy _ssss_tttt_rrrr_eeee_aaaa_mmmm _ssss_tttt_oooo_rrrr_eeee_dddd _iiii_nnnn _GGGG_LLLL_SSSS _cccc_oooo_nnnn_tttt_eeee_xxxx_tttt _****_////
  207.          _GGGG_LLLL_SSSS______BBBB_IIII_NNNN_AAAA_RRRR_YYYY______LLLL_SSSS_BBBB______FFFF_IIII_RRRR_SSSS_TTTT    _////_**** _bbbb_iiii_nnnn_aaaa_rrrr_yyyy _ssss_tttt_rrrr_eeee_aaaa_mmmm_,,,, _llll_iiii_tttt_tttt_llll_eeee_----_eeee_nnnn_dddd_iiii_aaaa_nnnn _****_////
  208.          _GGGG_LLLL_SSSS______BBBB_IIII_NNNN_AAAA_RRRR_YYYY______MMMM_SSSS_BBBB______FFFF_IIII_RRRR_SSSS_TTTT    _////_**** _bbbb_iiii_nnnn_aaaa_rrrr_yyyy _ssss_tttt_rrrr_eeee_aaaa_mmmm_,,,, _bbbb_iiii_gggg_----_eeee_nnnn_dddd_iiii_aaaa_nnnn _****_////
  209.          _GGGG_LLLL_SSSS______TTTT_EEEE_XXXX_TTTT                _////_**** _tttt_eeee_xxxx_tttt _ssss_tttt_rrrr_eeee_aaaa_mmmm _****_////
  210.  
  211.      The _i_n_W_r_i_t_e_F_l_a_g_s argument to ggggllllssssBBBBeeeeggggiiiinnnnCCCCaaaappppttttuuuurrrreeee(((()))) is a mask. Zero or more
  212.      attributes can be OR'ed together to set various options:
  213.  
  214.          _GGGG_LLLL_SSSS______WWWW_RRRR_IIII_TTTT_EEEE______AAAA_PPPP_PPPP_EEEE_NNNN_DDDD______BBBB_IIII_TTTT    _////_**** _iiii_ffff _ssss_tttt_rrrr_eeee_aaaa_mmmm _eeee_xxxx_iiii_ssss_tttt_ssss_,,,, _dddd_oooo_nnnn_''''_tttt _tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee _****_////
  215.          _GGGG_LLLL_SSSS______WWWW_RRRR_IIII_TTTT_EEEE______BBBB_AAAA_RRRR_EEEE______BBBB_IIII_TTTT      _////_**** _dddd_oooo_nnnn_''''_tttt _eeee_nnnn_cccc_oooo_dddd_eeee _gggg_llll_ssss_BBBB_eeee_gggg_iiii_nnnn_GGGG_LLLL_SSSS_////_gggg_llll_ssss_EEEE_nnnn_dddd_GGGG_LLLL_SSSS _****_////
  216.  
  217.      Here's how the different values for _i_n_S_t_r_e_a_m_T_y_p_e affect the capture
  218.      process:
  219.  
  220.      *    If _i_n_S_t_r_e_a_m_T_y_p_e is GGGGLLLLSSSS____CCCCOOOONNNNTTTTEEEEXXXXTTTT, ggggllllssssBBBBeeeeggggiiiinnnnCCCCaaaappppttttuuuurrrreeee(((()))) opens an in-memory
  221.           stream named _i_n_S_t_r_e_a_m_N_a_m_e that is stored in the current GLS context.
  222.           Within the constraints of available memory, a GLS context can
  223.           contain an arbitrary number of named GGGGLLLLSSSS____CCCCOOOONNNNTTTTEEEEXXXXTTTT streams.
  224.           GGGGLLLLSSSS____CCCCOOOONNNNTTTTEEEEXXXXTTTT streams can be thought of as client-side display lists
  225.           that complement the server-side display lists provided by core GL.
  226.  
  227.      *    If _i_n_S_t_r_e_a_m_T_y_p_e is GGGGLLLLSSSS____BBBBIIIINNNNAAAARRRRYYYY____LLLLSSSSBBBB____FFFFIIIIRRRRSSSSTTTT, GGGGLLLLSSSS____BBBBIIIINNNNAAAARRRRYYYY____MMMMSSSSBBBB____FFFFIIIIRRRRSSSSTTTT, or
  228.           GGGGLLLLSSSS____TTTTEEEEXXXXTTTT, the name of the opened stream is formed by appending
  229.           _i_n_S_t_r_e_a_m_N_a_m_e to a write-prefix string that is stored in the current
  230.           GLS context.
  231.  
  232.           Use ggggllllssssWWWWrrrriiiitttteeeePPPPrrrreeeeffffiiiixxxx(((()))) to replace the value of the write-prefix
  233.           string. See "Modifying Stream Capture and Playback" below.
  234.  
  235.      *    If _i_n_S_t_r_e_a_m_T_y_p_e is GGGGLLLLSSSS____BBBBIIIINNNNAAAARRRRYYYY____LLLLSSSSBBBB____FFFFIIIIRRRRSSSSTTTT, GGGGLLLLSSSS____BBBBIIIINNNNAAAARRRRYYYY____MMMMSSSSBBBB____FFFFIIIIRRRRSSSSTTTT, or
  236.           GGGGLLLLSSSS____TTTTEEEEXXXXTTTT, and _i_n_S_t_r_e_a_m_N_a_m_e is not the empty string (""), the command
  237.           ggggllllssssBBBBeeeeggggiiiinnnnCCCCaaaappppttttuuuurrrreeee(((()))) uses the standard C library command ffffooooppppeeeennnn(((()))) to
  238.           create a write channel of type FILE*.
  239.  
  240.      *    If _i_n_S_t_r_e_a_m_T_y_p_e is GGGGLLLLSSSS____BBBBIIIINNNNAAAARRRRYYYY____LLLLSSSSBBBB____FFFFIIIIRRRRSSSSTTTT, GGGGLLLLSSSS____BBBBIIIINNNNAAAARRRRYYYY____MMMMSSSSBBBB____FFFFIIIIRRRRSSSSTTTT, or
  241.           GGGGLLLLSSSS____TTTTEEEEXXXXTTTT, and _i_n_S_t_r_e_a_m_N_a_m_e is the empty string, and the GLS client
  242.           has used the command ggggllllssssWWWWrrrriiiitttteeeeFFFFuuuunnnncccc(((())))  specify a write callback
  243.           function, that function is used in place of the standard C library
  244.           function ffffwwwwrrrriiiitttteeee(((()))) to write bytes to the stream.
  245.  
  246.      *    If _i_n_S_t_r_e_a_m_T_y_p_e is GGGGLLLLSSSS____BBBBIIIINNNNAAAARRRRYYYY____LLLLSSSSBBBB____FFFFIIIIRRRRSSSSTTTT, GGGGLLLLSSSS____BBBBIIIINNNNAAAARRRRYYYY____MMMMSSSSBBBB____FFFFIIIIRRRRSSSSTTTT, or
  247.           GGGGLLLLSSSS____TTTTEEEEXXXXTTTT, and _i_n_S_t_r_e_a_m_N_a_m_e is the empty string, and if
  248.           ggggllllssssWWWWrrrriiiitttteeeeFFFFuuuunnnncccc(((()))) is not defined, ggggllllssssBBBBeeeeggggiiiinnnnCCCCaaaappppttttuuuurrrreeee(((()))) uses a default
  249.           write channel of type FILE* that is stored in the current GLS
  250.           context (initial value: stdout).
  251.  
  252.           In that case, use ggggllllssssCCCChhhhaaaannnnnnnneeeellll(((()))) to replace the value of the default
  253.           write channel. See "Modifying Stream Capture and Playback" below.
  254.  
  255.    BBBBaaaassssiiiicccc SSSSttttrrrreeeeaaaammmm PPPPllllaaaayyyybbbbaaaacccckkkk
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))                 OOOOppppeeeennnnGGGGLLLL SSSSttttrrrreeeeaaaammmm CCCCooooddddeeeecccc                  ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))
  269.  
  270.  
  271.  
  272.      ggggllllssssCCCCaaaallllllllSSSSttttrrrreeeeaaaammmm(((()))) decodes a named GLS stream (which may be in any GLS
  273.      encoding) and issues the commands in the stream to GL and GLS, just as if
  274.      those commands had been issued directly in immediate mode by the calling
  275.      thread. The command returns the type of the stream.
  276.  
  277.          _GGGG_LLLL_SSSS_eeee_nnnn_uuuu_mmmm _gggg_llll_ssss_CCCC_aaaa_llll_llll_SSSS_tttt_rrrr_eeee_aaaa_mmmm_((((_cccc_oooo_nnnn_ssss_tttt _GGGG_LLLL_SSSS_cccc_hhhh_aaaa_rrrr _****_iiii_nnnn_SSSS_tttt_rrrr_eeee_aaaa_mmmm_NNNN_aaaa_mmmm_eeee_))))_;;;;
  278.  
  279.      What happens when you call ggggllllssssCCCCaaaallllllllSSSSttttrrrreeeeaaaammmm(((()))) depends on the value of
  280.      _i_n_S_t_r_e_a_m_N_a_m_e and other factors:
  281.  
  282.      *    If _i_n_S_t_r_e_a_m_N_a_m_e is the name of a GGGGLLLLSSSS____CCCCOOOONNNNTTTTEEEEXXXXTTTT in-memory stream stored
  283.           in the current GLS context, ggggllllssssCCCCaaaallllllllSSSSttttrrrreeeeaaaammmm(((()))) decodes that stream.
  284.           Otherwise, the command searches for an external stream to decode.
  285.  
  286.      *    If _i_n_S_t_r_e_a_m_N_a_m_e is not the empty string (""), a sequence of
  287.           potential external stream names is formed.  The first names in the
  288.           sequence are formed by appending _i_n_S_t_r_e_a_m_N_a_m_e to each of the strings
  289.           in a list of read-prefix strings that is stored in the current GLS
  290.           context.   The last name in the sequence is formed by appending
  291.           _i_n_S_t_r_e_a_m_N_a_m_e to the write-prefix string.
  292.  
  293.           Use the commands ggggllllssssAAAAppppppppeeeennnnddddRRRReeeeaaaaddddPPPPrrrreeeeffffiiiixxxx(((()))) and ggggllllssssPPPPrrrreeeeppppeeeennnnddddRRRReeeeaaaaddddPPPPrrrreeeeffffiiiixxxx(((()))) to
  294.           modify the contents of the read-prefix string list. See "Modifying
  295.           Stream Capture and Playback" for more information.
  296.  
  297.           Beginning with the first potential external stream name,
  298.           ggggllllssssCCCCaaaallllllllSSSSttttrrrreeeeaaaammmm(((()))) tries each successive name until either a readable
  299.           stream is found or all of the names have been tried.  For each name,
  300.           the command ffffooooppppeeeennnn(((()))) is issued with the name as an argument, in an
  301.           attempt to create a read channel of type FILE*.
  302.  
  303.      *    If _i_n_S_t_r_e_a_m_N_a_m_e is the empty string, the command ggggllllssssCCCCaaaallllllllSSSSttttrrrreeeeaaaammmm(((())))
  304.           uses a default read channel of type FILE* that is stored in the
  305.           current GLS context (initial value: stdin). Use command ggggllllssssCCCChhhhaaaannnnnnnneeeellll(((())))
  306.           (see "Modifying Capture and Playback")  to replace the value of the
  307.           default read channel.
  308.  
  309.      *    If _i_n_S_t_r_e_a_m_N_a_m_e is the empty string, and the GLS client has used the
  310.           command ggggllllssssRRRReeeeaaaaddddFFFFuuuunnnncccc(((()))) to specify a read callback function, that
  311.           function is used in place of the standard C library function ffffrrrreeeeaaaadddd(((())))
  312.           when bytes are to be read from the stream.
  313.  
  314.      The command ggggllllssssCCCCaaaallllllllSSSSttttrrrreeeeaaaammmm(((()))) is encodable.  When a GLS decoder reads this
  315.      command from a GLS stream, the decoder recursively decodes the GLS stream
  316.      named in the command.  As a result, GLS streams provide the same
  317.      embedding capability on the client side that GL display lists provide on
  318.      the server side.
  319.  
  320.    MMMMooooddddiiiiffffyyyyiiiinnnngggg CCCCaaaappppttttuuuurrrreeee aaaannnndddd PPPPllllaaaayyyybbbbaaaacccckkkk
  321.      You can modify stream capture and playback in several ways, all discussed
  322.      in more detail below:
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))                 OOOOppppeeeennnnGGGGLLLL SSSSttttrrrreeeeaaaammmm CCCCooooddddeeeecccc                  ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))
  335.  
  336.  
  337.  
  338.      *    Call ggggllllssssCCCCaaaappppttttuuuurrrreeeeFFFFllllaaaaggggssss(((()))) to specify the destination of a command.
  339.  
  340.      *    Call ggggllllssssCCCCoooommmmmmmmaaaannnnddddFFFFuuuunnnncccc(((()))) to register a callback function.
  341.  
  342.      *    Call ggggllllssssAAAAppppppppeeeennnnddddRRRReeeeaaaaddddPPPPrrrreeeeffffiiiixxxx(((()))) or ggggllllssssPPPPrrrreeeeppppeeeennnnddddRRRReeeeaaaaddddPPPPrrrreeeeffffiiiixxxx(((()))) to modify the
  343.           read prefix string list.
  344.  
  345.      *    Call ggggllllssssWWWWrrrriiiitttteeeePPPPrrrreeeeffffiiiixxxx(((()))) to replace the value of the write prefix
  346.           string.
  347.  
  348.      *    Call ggggllllssssCCCChhhhaaaannnnnnnneeeellll(((()))) to replace the value of the default write channel
  349.  
  350.      ggggllllssssCCCCaaaappppttttuuuurrrreeeeFFFFllllaaaaggggssss(((()))) allows a GLS client to specify on a per-opcode basis
  351.      whether a captured GL or encodable GLS command is written to the open
  352.      stream and/or executed by GL or GLS.
  353.  
  354.          _vvvv_oooo_iiii_dddd _gggg_llll_ssss_CCCC_aaaa_pppp_tttt_uuuu_rrrr_eeee_FFFF_llll_aaaa_gggg_ssss_((((_GGGG_LLLL_SSSS_oooo_pppp_cccc_oooo_dddd_eeee _iiii_nnnn_OOOO_pppp_cccc_oooo_dddd_eeee_,,,, _GGGG_LLLL_iiii_nnnn_tttt _iiii_nnnn_FFFF_llll_aaaa_gggg_ssss_))))_;;;;
  355.  
  356.      A GLS context contains the following capture-mode control bits for each
  357.      opcode, set with the _i_n_F_l_a_g_s parameter:
  358.  
  359.          _GGGG_LLLL_SSSS______CCCC_AAAA_PPPP_TTTT_UUUU_RRRR_EEEE______WWWW_RRRR_IIII_TTTT_EEEE______BBBB_IIII_TTTT   _////_**** _wwww_rrrr_iiii_tttt_eeee _cccc_oooo_mmmm_mmmm_aaaa_nnnn_dddd _tttt_oooo _oooo_pppp_eeee_nnnn _ssss_tttt_rrrr_eeee_aaaa_mmmm _****_////
  360.          _GGGG_LLLL_SSSS______CCCC_AAAA_PPPP_TTTT_UUUU_RRRR_EEEE______EEEE_XXXX_EEEE_CCCC_UUUU_TTTT_EEEE______BBBB_IIII_TTTT _////_**** _eeee_xxxx_eeee_cccc_uuuu_tttt_eeee _cccc_oooo_mmmm_mmmm_aaaa_nnnn_dddd _****_////
  361.  
  362.      ggggllllssssCCCCoooommmmmmmmaaaannnnddddFFFFuuuunnnncccc(((()))) registers the client callback function _i_n_F_u_n_c for the GL
  363.      or encodable GLS command designated by _i_n_O_p_c_o_d_e.  There are two types of
  364.      callback function:  GGGGLLLLSSSS____CCCCAAAALLLLLLLL____FFFFUUUUNNNNCCCC and GGGGLLLLSSSS____CCCCAAAAPPPPTTTTUUUURRRREEEE____FFFFUUUUNNNNCCCC.  The parameter
  365.      _i_n_A_t_t_r_i_b identifies the type of function to be registered.
  366.  
  367.      When a GLS decoder reads a command from a GLS stream, and a GGGGLLLLSSSS____CCCCAAAALLLLLLLL____FFFFUUUUNNNNCCCC
  368.      function has been registered for that command, the decoder calls that
  369.      function instead of issuing the command.
  370.  
  371.      When GLS captures a command, and a GGGGLLLLSSSS____CCCCAAAAPPPPTTTTUUUURRRREEEE____FFFFUUUUNNNNCCCC function has been
  372.      registered for that command, GLS calls that function instead of the
  373.      standard GLS capture function for that command.  If desired, the callback
  374.      function may call the standard GLS capture function, which is named
  375.      GLScapture_<commandname>.
  376.  
  377.          _vvvv_oooo_iiii_dddd _gggg_llll_ssss_CCCC_oooo_mmmm_mmmm_aaaa_nnnn_dddd_FFFF_uuuu_nnnn_cccc_((((_GGGG_LLLL_SSSS_eeee_nnnn_uuuu_mmmm _iiii_nnnn_AAAA_tttt_tttt_rrrr_iiii_bbbb_,,,, _GGGG_LLLL_SSSS_oooo_pppp_cccc_oooo_dddd_eeee _iiii_nnnn_OOOO_pppp_cccc_oooo_dddd_eeee_,,,, _GGGG_LLLL_SSSS_cccc_oooo_mmmm_mmmm_aaaa_nnnn_dddd_FFFF_uuuu_nnnn_cccc _iiii_nnnn_FFFF_uuuu_nnnn_cccc_))))_;;;;
  378.  
  379.      Command arguments are passed to _i_n_F_u_n_c just as they be passed to the
  380.      function that implements the GL or GLS command.  The function _i_n_F_u_n_c is
  381.      free to perform arbitrary computations, including issuing GL and GLS
  382.      commands.
  383.  
  384.      Certain encodable GLS commands are provided for the sole purpose of
  385.      encoding arrays of arbitrary client data as command arguments in a GLS
  386.      stream.  If a GLS client provides a callback function for one or more of
  387.      these encodable GLS commands, the client can use GGGGLLLLSSSS____CCCCOOOONNNNTTTTEEEEXXXXTTTT in-memory
  388.      streams to create client-side display lists that contain client
  389.      callbacks.  This functionality is available in IrisGL but not in core GL.
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))                 OOOOppppeeeennnnGGGGLLLL SSSSttttrrrreeeeaaaammmm CCCCooooddddeeeecccc                  ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))
  401.  
  402.  
  403.  
  404.          _vvvv_oooo_iiii_dddd _gggg_llll_ssss_UUUU_nnnn_ssss_uuuu_pppp_pppp_oooo_rrrr_tttt_eeee_dddd_CCCC_oooo_mmmm_mmmm_aaaa_nnnn_dddd_((((_cccc_oooo_nnnn_ssss_tttt _GGGG_LLLL_SSSS_cccc_hhhh_aaaa_rrrr _****_iiii_nnnn_CCCC_oooo_mmmm_mmmm_aaaa_nnnn_dddd_))))_;;;;
  405.  
  406.      The GLS encodings and API are designed to handle GL extensions.
  407.      Extension commands are encoded and decoded in the same way as GL 1.0
  408.      commands.  Extension opcodes for the binary encodings will be allocated
  409.      on demand in blocks of 16 from a registry maintained by Silicon Graphics.
  410.  
  411.      To guarantee successful interchange of GLS streams, any GLS
  412.      implementation has to be able to read any GLS stream, even if that stream
  413.      contains extension commands that are not recognized by that GLS
  414.      implementation.
  415.  
  416.      If a GLS decoder reads a command that it cannot decode from a GLS stream,
  417.      the decoder issues the encodable GLS command ggggllllssssUUUUnnnnssssuuuuppppppppoooorrrrtttteeeeddddCCCCoooommmmmmmmaaaannnndddd(((()))).
  418.      Use ggggllllssssCCCCoooommmmmmmmaaaannnnddddFFFFuuuunnnncccc(((()))) to register a client callback function for the
  419.      command ggggllllssssUUUUnnnnssssuuuuppppppppoooorrrrtttteeeeddddCCCCoooommmmmmmmaaaannnndddd(((()))).
  420.  
  421.      ggggllllssssWWWWrrrriiiitttteeeePPPPrrrreeeeffffiiiixxxx(((()))) lets you replace the value of the write prefix string.
  422.      The function has the following prototype:
  423.  
  424.          _vvvv_oooo_iiii_dddd _gggg_llll_ssss_WWWW_rrrr_iiii_tttt_eeee_PPPP_rrrr_eeee_ffff_iiii_xxxx _((((_cccc_oooo_nnnn_ssss_tttt _GGGG_LLLL_SSSS_cccc_hhhh_aaaa_rrrr _****_iiii_nnnn_PPPP_rrrr_eeee_ffff_iiii_xxxx_))))_;;;;
  425.  
  426.      The write prefix string is appended to _i_n_S_t_r_e_a_m_N_a_m_e by ggggllllssssBBBBeeeeggggiiiinnnnCCCCaaaappppttttuuuurrrreeee(((()))).
  427.      Here's an example of using ggggllllssssWWWWrrrriiiitttteeeePPPPrrrreeeeffffiiiixxxx(((()))). This example captures into
  428.      the file "/usr/tmp/foo.gls
  429.  
  430.          _gggg_llll_ssss_WWWW_rrrr_iiii_tttt_eeee_PPPP_rrrr_eeee_ffff_iiii_xxxx_((((_""""_////_uuuu_ssss_rrrr_////_tttt_mmmm_pppp_////_""""_))))_;;;;
  431.          _gggg_llll_ssss_BBBB_eeee_gggg_iiii_nnnn_CCCC_aaaa_pppp_tttt_uuuu_rrrr_eeee_((((_""""_ffff_oooo_oooo_...._gggg_llll_ssss_""""_))))_;;;;
  432.          _gggg_llll_BBBB_eeee_gggg_iiii_nnnn_((((_GGGG_LLLL______PPPP_OOOO_IIII_NNNN_TTTT_SSSS_))))_;;;;
  433.          _gggg_llll_VVVV_eeee_rrrr_tttt_eeee_xxxx_3333_ffff_((((_1111_...._,,,, _2222_...._,,,, _3333_...._))))_;;;;
  434.          _gggg_llll_EEEE_nnnn_dddd_((((_))))_;;;;
  435.          _gggg_llll_ssss_EEEE_nnnn_dddd_CCCC_aaaa_pppp_tttt_uuuu_rrrr_eeee_((((_))))_;;;;
  436.  
  437.      ggggllllssssAAAAppppppppeeeennnnddddRRRReeeeaaaaddddPPPPrrrreeeeffffiiiixxxx(((()))) and ggggllllssssPPPPrrrreeeeppppeeeennnnddddRRRReeeeaaaaddddPPPPrrrreeeeffffiiiixxxx(((()))) can be used to change
  438.      the name given to ggggllllssssCCCCaaaallllllllSSSSttttrrrreeeeaaaammmm(((()))). They have the following prototypes:
  439.  
  440.          _vvvv_oooo_iiii_dddd _gggg_llll_ssss_PPPP_rrrr_eeee_pppp_eeee_nnnn_dddd_RRRR_eeee_aaaa_dddd_PPPP_rrrr_eeee_ffff_iiii_xxxx _((((_cccc_oooo_nnnn_ssss_tttt _GGGG_LLLL_SSSS_cccc_hhhh_aaaa_rrrr _****_iiii_nnnn_PPPP_rrrr_eeee_ffff_iiii_xxxx_))))
  441.          _vvvv_oooo_iiii_dddd _gggg_llll_ssss_AAAA_pppp_pppp_eeee_nnnn_dddd_RRRR_eeee_aaaa_dddd_PPPP_rrrr_eeee_ffff_iiii_xxxx _((((_cccc_oooo_nnnn_ssss_tttt _GGGG_LLLL_SSSS_cccc_hhhh_aaaa_rrrr _****_iiii_nnnn_PPPP_rrrr_eeee_ffff_iiii_xxxx_))))
  442.  
  443.      Here's an example that calls the stream /usr/tmp/foo.gls:
  444.  
  445.      _gggg_llll_ssss_AAAA_pppp_pppp_eeee_nnnn_dddd_RRRR_eeee_aaaa_dddd_PPPP_rrrr_eeee_ffff_iiii_xxxx_((((_""""_////_tttt_mmmm_pppp_////_""""_))))_;;;; _gggg_llll_ssss_AAAA_pppp_pppp_eeee_nnnn_dddd_RRRR_eeee_aaaa_dddd_PPPP_rrrr_eeee_ffff_iiii_xxxx_((((_""""_////_uuuu_ssss_rrrr_////_tttt_mmmm_pppp_////_""""_))))_;;;;
  446.      _gggg_llll_ssss_CCCC_aaaa_llll_llll_SSSS_tttt_rrrr_eeee_aaaa_mmmm_((((_""""_ffff_oooo_oooo_...._gggg_llll_ssss_""""_))))_;;;;
  447.  
  448. NNNNOOOOTTTTEEEESSSS
  449.      The GLS API and encodings are subject to change during the OpenGL ARB
  450.      multivendor standardization process for GLS, which is not yet complete.
  451.  
  452.      Due to the multivendor standardization process, the GLS API and binary
  453.      stream encodings that are supported in this release are NOT compatible
  454.      with the GLS API and binary stream encodings that were supported in IRIX
  455.      6.2.
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))                 OOOOppppeeeennnnGGGGLLLL SSSSttttrrrreeeeaaaammmm CCCCooooddddeeeecccc                  ggggllllssssIIIInnnnttttrrrroooo((((3333GGGG))))
  467.  
  468.  
  469.  
  470.      The GLS text stream encoding supported in this release is compatible with
  471.      the GLS text stream encoding that was supported in IRIX 6.2.  To convert
  472.      an IRIX 6.2 GLS binary stream to the new format, use the utility
  473.      /usr/sbin/glscat on an IRIX 6.2 system to convert to text format, then
  474.      use the version of /usr/sbin/glscat in the current release to convert
  475.      back to binary format:
  476.  
  477.      _iiii_rrrr_iiii_xxxx_6666_...._2222_>>>> _////_uuuu_ssss_rrrr_////_ssss_bbbb_iiii_nnnn_////_gggg_llll_ssss_cccc_aaaa_tttt _----_tttt _tttt _<<<< _iiii_nnnn_SSSS_tttt_rrrr_eeee_aaaa_mmmm _>>>> _oooo_uuuu_tttt_SSSS_tttt_rrrr_eeee_aaaa_mmmm
  478.  
  479.      _iiii_rrrr_iiii_xxxx_6666_...._XXXX_>>>> _////_uuuu_ssss_rrrr_////_ssss_bbbb_iiii_nnnn_////_gggg_llll_ssss_cccc_aaaa_tttt _----_tttt _bbbb _<<<< _iiii_nnnn_SSSS_tttt_rrrr_eeee_aaaa_mmmm _>>>> _oooo_uuuu_tttt_SSSS_tttt_rrrr_eeee_aaaa_mmmm
  480.  
  481.      IRIX 6.2 applications that use GLS must be recompiled to run with the new
  482.      version of GLS.  Note that the new parameter _i_n_A_t_t_r_i_b has been added to
  483.      the command ggggllllssssCCCCoooommmmmmmmaaaannnnddddFFFFuuuunnnncccc.  For existing code, the value of _i_n_A_t_t_r_i_b
  484.      should be GGGGLLLLSSSS____CCCCAAAALLLLLLLL____FFFFUUUUNNNNCCCC.
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.